emacs.git
2 years ago; Merge from origin/emacs-29
Eli Zaretskii [Sat, 9 Sep 2023 08:32:58 +0000 (04:32 -0400)]
; Merge from origin/emacs-29

The following commit was skipped:

14819131fff Fix c-ts-mode BSD style indentation

2 years agoMerge from origin/emacs-29
Eli Zaretskii [Sat, 9 Sep 2023 08:32:45 +0000 (04:32 -0400)]
Merge from origin/emacs-29

bc56da92d8d ; Fix error in 'tex-recenter-output-buffer'
d17c5adc057 Fix regexp for recognizing PBM images
9e9f61866e7 Improve wording in ELisp manual
7427efa033b Fix typo (Bug#65764)
59c66244080 ; * lisp/ido.el (ido-completion-buffer): Fix :type (bug#6...
4ec4b18c2a0 Fix libgccjit build on Haiku
80bdcf8f351 (regexp-tests-backtrack-optimization): Mark it as failing
8a9e653cc82 ; Add regression test for bug#65726
6fad73d7cc5 * src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop ...
1d3d4196073 ; * lisp/files.el (save-some-buffers-functions): Doc fix ...
42b14c6e5bb Bump seq version to 2.24
ff5190a174f Add note on ELPA to admin/notes/bug-triage
f1e4cbe72aa ; * etc/PROBLEMS: Minor wording fix.
fd5593c7f25 * etc/PROBLEMS: Mention bug#65432 and its remedy.
dd896ea1e62 Ignore errors when checking for object initializers (bug#...
3550f44c17c ; Fix typos
5b246b9b817 * CONTRIBUTE: Document making ChangeLogs with Magit.
0bd46619413 Doc fixes for obsolete functions and variables
524c0c34f24 ; * lisp/ffap.el (ffap-rfs-regexp): Fix :type (bug#65698).
f48dccc4675 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
71a85e22668 A revision to the Widget manual
dbbcf4a6599 Fix fontification of " in edit-kbd-macro

# Conflicts:
# test/src/regex-emacs-tests.el

2 years ago; * lisp/progmodes/c-ts-mode.el (treesit-parser-root-node): Declare.
Eli Zaretskii [Sat, 9 Sep 2023 08:29:48 +0000 (11:29 +0300)]
; * lisp/progmodes/c-ts-mode.el (treesit-parser-root-node): Declare.

2 years agoUpdate Android port
Po Lu [Sat, 9 Sep 2023 07:49:47 +0000 (15:49 +0800)]
Update Android port

* src/android-asset.h (android_asset_read_internal): Return an
error indication if an exception arises while reading.
(AAsset_getBuffer): Free BUFFER using the C library free
function.

2 years ago; Fix last change
Jim Porter [Sat, 9 Sep 2023 05:24:06 +0000 (22:24 -0700)]
; Fix last change

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Make sure we have no *new*
processes, instead of making sure we have no processes at all.

2 years ago; Fix name of an Eshell test
Jim Porter [Sat, 9 Sep 2023 04:08:57 +0000 (21:08 -0700)]
; Fix name of an Eshell test

* test/lisp/eshell/esh-proc-tests.el
(esh-var-test/output/remote-redirect): Rename to...
(esh-proc-test/output/remote-redirect): ... this.

2 years ago* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Fix bug#65833
Stefan Monnier [Sat, 9 Sep 2023 02:17:43 +0000 (22:17 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Fix bug#65833

For some reason the intervals case failed to push the var to
`loop-for-bindings` before pushing to `loop-for-sets`.
AFAICT this was the only place where we made that mistake.

2 years agoMicro-optimize sfnt_interpret_trap
Po Lu [Sat, 9 Sep 2023 02:00:17 +0000 (10:00 +0800)]
Micro-optimize sfnt_interpret_trap

* src/sfnt.c (AVOID) [TEST]: Define to its standard value in
lisp.h.
(sfnt_interpret_trap): Label AVOID.

2 years ago* lisp/tempo.el (tempo-insert): Use `pcase` and `dolist`
Stefan Monnier [Fri, 8 Sep 2023 23:41:28 +0000 (19:41 -0400)]
* lisp/tempo.el (tempo-insert): Use `pcase` and `dolist`

2 years ago* lisp/tempo.el (tempo-find-match-string): Simplify
Stefan Monnier [Fri, 8 Sep 2023 23:24:53 +0000 (19:24 -0400)]
* lisp/tempo.el (tempo-find-match-string): Simplify

2 years ago* lisp/tempo.el: Remove left over uses of the dynbind dialect
Stefan Monnier [Fri, 8 Sep 2023 23:22:16 +0000 (19:22 -0400)]
* lisp/tempo.el: Remove left over uses of the dynbind dialect

* lisp/tempo.el (tempo-define-template): Use a real closure.
(tempo-insert, tempo-build-collection): Use lexical scoping.

2 years ago(tempo-user-elements): Make it a proper hook
Stefan Monnier [Fri, 8 Sep 2023 23:18:28 +0000 (19:18 -0400)]
(tempo-user-elements): Make it a proper hook

* lisp/tempo.el (tempo-user-element-functions): Rename from
`tempo-user-elements`.
(tempo-user-elements): Preserve as obsolete alias.
(tempo-is-user-element): Use `run-hook-with-args-until-success`.

2 years ago* lisp/tempo.el: Remove redundant `:group`s and use #'
Stefan Monnier [Fri, 8 Sep 2023 23:15:11 +0000 (19:15 -0400)]
* lisp/tempo.el: Remove redundant `:group`s and use #'

2 years ago; * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Fix typo.
Yuan Fu [Fri, 8 Sep 2023 17:10:32 +0000 (10:10 -0700)]
; * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Fix typo.

2 years agoExtract c-ts-mode--feature-list out
Yuan Fu [Fri, 8 Sep 2023 16:39:54 +0000 (09:39 -0700)]
Extract c-ts-mode--feature-list out

* lisp/progmodes/c-ts-mode.el (c-ts-mode--feature-list): New variable.

2 years ago; * lisp/treesit.el (treesit--indent-1): Get all parsers.
Yuan Fu [Fri, 8 Sep 2023 16:09:14 +0000 (09:09 -0700)]
; * lisp/treesit.el (treesit--indent-1): Get all parsers.

2 years ago; * lisp/treesit.el (treesit--indent-1): Add missing call.
Yuan Fu [Fri, 8 Sep 2023 16:07:46 +0000 (09:07 -0700)]
; * lisp/treesit.el (treesit--indent-1): Add missing call.

2 years ago* lisp/pcomplete.el (pcomplete-completions-at-point): Add hack for bug#65089
Stefan Monnier [Fri, 8 Sep 2023 15:31:35 +0000 (11:31 -0400)]
* lisp/pcomplete.el (pcomplete-completions-at-point): Add hack for bug#65089

Improve our guess for `end` and `buftext` when point is not at the end
of the current "thing to complete".

2 years agoMark two flyspell functions as internal
Stefan Kangas [Fri, 8 Sep 2023 14:47:33 +0000 (16:47 +0200)]
Mark two flyspell functions as internal

* lisp/textmodes/flyspell.el: Minor doc fix.
(flyspell--mode-on, flyspell--mode-off): Rename from
'flyspell-mode-on' and 'flyspell-mode-off'.  The old names are
preserved as obsolete aliases.

2 years agoAvoid errors in EWW when EWW is killed
Eli Zaretskii [Fri, 8 Sep 2023 12:11:10 +0000 (15:11 +0300)]
Avoid errors in EWW when EWW is killed

* lisp/net/eww.el (eww-render): Don't signal errors if the page
being rendered was closed.  (Bug#65678)

2 years ago; * doc/lispref/display.texi (Low-Level Font): Fix last change.
Eli Zaretskii [Fri, 8 Sep 2023 12:06:03 +0000 (15:06 +0300)]
; * doc/lispref/display.texi (Low-Level Font): Fix last change.

2 years agoFix typos
Po Lu [Fri, 8 Sep 2023 11:57:40 +0000 (19:57 +0800)]
Fix typos

* src/android.c (android_set_task_name):

* src/sfnt.c (main): Test if fd < 0, not fd < 1.

2 years agoFix Perl script in Tramp
Michael Albinus [Fri, 8 Sep 2023 09:07:54 +0000 (11:07 +0200)]
Fix Perl script in Tramp

* lisp/net/tramp-sh.el (tramp-perl-file-name-all-completions):
Fix Perl script.  (Bug#65744)

2 years agoProperly detect content files in Doc View
Po Lu [Fri, 8 Sep 2023 08:12:12 +0000 (16:12 +0800)]
Properly detect content files in Doc View

* lisp/doc-view.el (doc-view-mode): Detect if file name starts
with /content or /assets, and don't regard it as available to
subprocesses in that case.

2 years agoFix typos in last change
Po Lu [Fri, 8 Sep 2023 03:00:10 +0000 (11:00 +0800)]
Fix typos in last change

* src/font.c (font_dynamic_unparse_xlfd): Remove unused variable.
(Ffont_xlfd_name): Initialize name.

2 years ago; * src/fontset.c: Remove extraneous portion of last change.
Po Lu [Fri, 8 Sep 2023 02:37:53 +0000 (10:37 +0800)]
; * src/fontset.c: Remove extraneous portion of last change.

2 years agoPermit XLFD names to exceed 255 characters
Po Lu [Fri, 8 Sep 2023 02:37:18 +0000 (10:37 +0800)]
Permit XLFD names to exceed 255 characters

* doc/lispref/display.texi (Low-Level Font)
<font-xlfd-name>: Document new argument `long-xlfds'.

* etc/NEWS: Mention removal of XLFD length restrictions.

* src/font.c (font_build_object): Dynamically allocate XLFD,
permitting them to surpass 255 characters in length.
(font_parse_xlfd_1): Cease rejecting XLFDs more than 255
characters in length.
(font_dynamic_unparse_xlfd): New function.  Like
font_unparse_xlfd, but allocate the XLFD dynamically.
(font_delete_unmatched): Dynamically allocate XLFD if necessary.
(Ffont_xlfd_name): New arg LONG_XLFDs.  If t, return a
dynamically allocated XLFD.  All callers changed.

* src/font.h: Update prototypes.

* src/fontset.c (Fnew_fontset): Dynamically allocate XLFD when
establishing fontset name.

2 years agoFix treesit-thing-definition
Yuan Fu [Fri, 8 Sep 2023 00:56:11 +0000 (17:56 -0700)]
Fix treesit-thing-definition

* lisp/treesit.el (treesit-thing-definition): Don't modify
treesit-thing-settings itself.

2 years ago; * lisp/treesit.el (treesit-node-on): Fix treesit-local-parsers-on.
Yuan Fu [Fri, 8 Sep 2023 00:44:32 +0000 (17:44 -0700)]
; * lisp/treesit.el (treesit-node-on): Fix treesit-local-parsers-on.

2 years agoFix treesit-thing-settings for c++-ts-mode (bug#65810)
Yuan Fu [Thu, 7 Sep 2023 23:08:42 +0000 (16:08 -0700)]
Fix treesit-thing-settings for c++-ts-mode (bug#65810)

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--thing-settings): New varaible.
(c-ts-base-mode): Use c-ts-mode--thing-settings.

2 years ago; * lisp/treesit.el (treesit-update-ranges): Fix use of parser-list.
Yuan Fu [Thu, 7 Sep 2023 23:03:01 +0000 (16:03 -0700)]
; * lisp/treesit.el (treesit-update-ranges): Fix use of parser-list.

2 years agoAdd Ftreesit_parser_tag
Yuan Fu [Thu, 7 Sep 2023 05:15:21 +0000 (22:15 -0700)]
Add Ftreesit_parser_tag

* lisp/treesit.el (treesit-parser-tag): Add.
* src/treesit.c (Ftreesit_parser_tag): Add.

2 years agoChange treesit-local-parsers-in to treesit-local-parsers-on
Yuan Fu [Thu, 7 Sep 2023 23:04:29 +0000 (16:04 -0700)]
Change treesit-local-parsers-in to treesit-local-parsers-on

To improve consistency. We already have treesit-node-at and
treesit-node-on.

* doc/lispref/parsing.texi (Multiple Languages): Update manual.
* lisp/treesit.el (treesit-local-parsers-on): Change to in.
(treesit-font-lock-fontify-region): Change to in.

2 years agoError when trying to make nil or t obsolete
Stefan Kangas [Wed, 6 Sep 2023 09:21:39 +0000 (11:21 +0200)]
Error when trying to make nil or t obsolete

* lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
Signal error if the symbol to make obsolete is nil or t.  (Bug#62248)
(byte-run--constant-obsolete-warning): New function.
* test/lisp/emacs-lisp/byte-run-tests.el: New file.

2 years agoAdd note regarding `seq` on GNU ELPA
Stefan Kangas [Thu, 7 Sep 2023 21:50:50 +0000 (23:50 +0200)]
Add note regarding `seq` on GNU ELPA

* lisp/emacs-lisp/seq.el: Add note regarding seq on GNU ELPA.

Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
2 years agoFix detection of vtable start and end
Lämppi Lütti [Sat, 22 Oct 2022 04:58:46 +0000 (07:58 +0300)]
Fix detection of vtable start and end

* lisp/emacs-lisp/vtable.el (vtable-beginning-of-table)
(vtable-end-of-table): Fix detection of vtable limits.  (Bug#58712)

Copyright-paperwork-exempt: yes

2 years agoTranslate backslash-saturated regexp to rx
Mattias Engdegård [Thu, 7 Sep 2023 16:06:34 +0000 (18:06 +0200)]
Translate backslash-saturated regexp to rx

* lisp/minibuffer.el (minibuffer--regexp-propertize):
The original regexp had 83 backslashes in 147 characters which may be
some kind of record.  This transformation cuts it down to 6, and the
generated regexp string is about 14 % shorter.

2 years ago* admin/unidata/emoji-zwj.awk: More efficient code generation
Mattias Engdegård [Thu, 7 Sep 2023 09:25:46 +0000 (11:25 +0200)]
* admin/unidata/emoji-zwj.awk: More efficient code generation

Hoist the `eval-when-compile` to encompass the entire list, since
backquote forms aren't automatically evaluated at compile time.
This results in a single constant list in the generated code, and
much less actual code.

2 years agoFix java-ts-mode tests (bug#65738)
john muhl [Mon, 4 Sep 2023 16:36:42 +0000 (11:36 -0500)]
Fix java-ts-mode tests (bug#65738)

* admin/notes/tree-sitter/build-module/batch.sh (languages):
Add Java.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Pass a list
to 'treesit-thing-settings'.

2 years ago; Fix documentation of last change
Eli Zaretskii [Thu, 7 Sep 2023 08:56:16 +0000 (11:56 +0300)]
; Fix documentation of last change

* lisp/minibuffer.el (minibuffer-regexp-prompts):
* doc/lispref/minibuf.texi (Minibuffer Misc): Fix docs (bug#50766).

2 years agoNew minor mode 'minibuffer-regexp-mode'
martin rudalics [Wed, 6 Sep 2023 08:09:49 +0000 (10:09 +0200)]
New minor mode 'minibuffer-regexp-mode'

This mode is for editing regexps in minibuffer, it highlights
parens via `show-paren-mode' and `blink-matching-paren' in a
user-friendly way, avoids reporting false paren mismatches,
and makes sexp navigation more intuitive.
* lisp/minibuffer.el (minibuffer-regexp-mode)
(minibuffer--regexp-primed, minibuffer--regexp-prompt-regexp):
New variables.
(minibuffer--regexp-propertize, minibuffer--regexp-primed)
(minibuffer--regexp-before-change)
(minibuffer--regexp-after-change)
(minibuffer--regexp-post-self-insert, minibuffer--regexp-setup)
(minibuffer--regexp-exit, minibuffer-regexp-mode): New functions.
(minibuffer-regexp-prompts): New option.

* doc/lispref/minibuf.texi (Minibuffer Misc): Document the new
mode and its option.

* etc/NEWS: Announce the new mode.

Bug#50766

2 years ago; Fix recent changes in treesit documentation
Eli Zaretskii [Thu, 7 Sep 2023 08:09:56 +0000 (11:09 +0300)]
; Fix recent changes in treesit documentation

* lisp/treesit.el (treesit-local-parsers-at)
(treesit-local-parsers-in):
* doc/lispref/parsing.texi (Multiple Languages):
 (Using Parser): Fix wording of recently added docs.

2 years agoFix c-ts-mode BSD style indentation
Yuan Fu [Wed, 6 Sep 2023 03:12:19 +0000 (20:12 -0700)]
Fix c-ts-mode BSD style indentation

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
Add else_clause.

(cherry picked from commit d392a5d3c11b7e7479d31421f8237f29952c909e)

2 years agoTag NEWS
Po Lu [Thu, 7 Sep 2023 03:02:12 +0000 (11:02 +0800)]
Tag NEWS

* etc/NEWS: Tag Android as documented, given that all pertinent
documentation has been written.

2 years ago; * ChangeLog.android: Minor formatting correction.
Po Lu [Thu, 7 Sep 2023 02:32:23 +0000 (02:32 +0000)]
; * ChangeLog.android: Minor formatting correction.

2 years agoPort Proced to Android
Po Lu [Thu, 7 Sep 2023 01:35:59 +0000 (09:35 +0800)]
Port Proced to Android

* configure.ac (HAVE_PROCFS): Define if opsys is `android'.

* src/android.c (android_set_task_name): New function.
(android_run_select_thread, android_run_debug_thread): Set the
name of the LWP for debugging purposes.

* src/process.c (create_process): Set F_SETPIPE_SZ on Android in
addition to GNU/Linux.

* src/sysdep.c (procfs_ttyname, system_process_attributes)
[__ANDROID__]: Enable procfs_ttyname on Android systems.

2 years agoRemedy bug#63395
Po Lu [Thu, 7 Sep 2023 00:58:21 +0000 (08:58 +0800)]
Remedy bug#63395

* src/gtkutil.c (xg_update_frame_menubar): Avoid scaling the
requisiton height twice.  (bug#63395)

2 years agoFix perl-mode indentation after a hanging paren
Mauro Aranda [Thu, 20 Oct 2022 11:41:42 +0000 (08:41 -0300)]
Fix perl-mode indentation after a hanging paren

* lisp/progmodes/perl-mode.el (perl-hanging-paren-p): Allow
comments.  (Bug#34245)
* test/lisp/progmodes/perl-mode-tests.el (perl-test-bug-34245): New
test.

2 years ago* lisp/progmodes/project.el: Bump version to 0.10.0.
Dmitry Gutov [Wed, 6 Sep 2023 20:54:30 +0000 (23:54 +0300)]
* lisp/progmodes/project.el: Bump version to 0.10.0.

2 years ago(project-try-vc): When found non-VC project root, still search for the backend
Dmitry Gutov [Wed, 6 Sep 2023 20:30:27 +0000 (23:30 +0300)]
(project-try-vc): When found non-VC project root, still search for the backend

* lisp/progmodes/project.el (project-try-vc): When finding a
non-VC project root, still try to search for the containing
responsible VC backend, if any (bug#65704).

2 years ago; Fix error in 'tex-recenter-output-buffer'
Eshel Yaron [Tue, 5 Sep 2023 16:58:02 +0000 (18:58 +0200)]
; Fix error in 'tex-recenter-output-buffer'

* lisp/textmodes/tex-mode.el (tex-recenter-output-buffer): Check
that 'display-buffer' returned a window, rather than nil, before
selecting it.  (Bug#65762)

2 years agoRemove compat code from flyspell
Stefan Kangas [Wed, 6 Sep 2023 16:34:40 +0000 (18:34 +0200)]
Remove compat code from flyspell

* lisp/textmodes/flyspell.el: Delete redundant autoloads.

2 years agoFix regexp for recognizing PBM images
David Ponce [Thu, 24 Aug 2023 10:55:03 +0000 (12:55 +0200)]
Fix regexp for recognizing PBM images

* lisp/image.el (image-type-header-regexps): Don't use [:space:],
as its meaning depends on the current buffer's syntax tables.
(Bug#65496)

2 years agoImprove wording in ELisp manual
Eli Zaretskii [Wed, 6 Sep 2023 12:49:11 +0000 (15:49 +0300)]
Improve wording in ELisp manual

* doc/lispref/objects.texi (Printed Representation): Improve
wording.  Suggested by Xie Shynur <one.last.kiss@outlook.com>.
(Bug# 60639)

2 years agoFix typo (Bug#65764)
Joseph Turner [Tue, 5 Sep 2023 19:05:58 +0000 (12:05 -0700)]
Fix typo (Bug#65764)

* lisp/subr.el (backward-word-strictly): Fix typo.

2 years ago; Silence byte-compiler
Stefan Kangas [Wed, 6 Sep 2023 11:00:30 +0000 (13:00 +0200)]
; Silence byte-compiler

* test/lisp/emacs-lisp/cl-lib-tests.el (old-struct)
(cl-lib-old-struct):
* test/lisp/progmodes/eglot-tests.el
(eglot-test-rust-analyzer-watches-files)
(eglot-test-capabilities, eglot-test-path-to-uri-windows):
Silence byte-compiler.

2 years ago; * lisp/ido.el (ido-completion-buffer): Fix :type (bug#65756).
Eli Zaretskii [Wed, 6 Sep 2023 10:49:32 +0000 (13:49 +0300)]
; * lisp/ido.el (ido-completion-buffer): Fix :type (bug#65756).

2 years ago; * lisp/leim/quail/indian.el: correct argument order
Mattias Engdegård [Wed, 6 Sep 2023 08:36:51 +0000 (10:36 +0200)]
; * lisp/leim/quail/indian.el: correct argument order

2 years agoindian.el: fix sorting predicate
Mattias Engdegård [Wed, 6 Sep 2023 08:05:25 +0000 (10:05 +0200)]
indian.el: fix sorting predicate

* lisp/leim/quail/indian.el
(quail-tamil-itrans-compute-syllable-table): Add missing comparison.
Patch from Visuwesh; bug found by an experimental tool.

2 years agoUse *p in interactive form in transpose-chars
Theodor Thornhill [Sat, 17 Dec 2022 12:14:22 +0000 (13:14 +0100)]
Use *p in interactive form in transpose-chars

* lisp/simple.el (transpose-chars): Use '*p' instead of '*P' like the
other transpose-* functions.  (Bug#60157)

2 years agoSupport local parser in treesit-node-at/on
Yuan Fu [Wed, 6 Sep 2023 04:02:13 +0000 (21:02 -0700)]
Support local parser in treesit-node-at/on

* lisp/treesit.el (treesit-node-at)
(treesit-node-on): Support local parser.

2 years ago; Update Ftreesit_parser_list docstring.
Yuan Fu [Wed, 6 Sep 2023 03:15:11 +0000 (20:15 -0700)]
; Update Ftreesit_parser_list docstring.

* doc/lispref/parsing.texi (Using Parser): Update manual.
* src/treesit.c (Ftreesit_parser_list): Update docstring.

2 years agoFix c-ts-mode BSD style indentation
Yuan Fu [Wed, 6 Sep 2023 03:12:19 +0000 (20:12 -0700)]
Fix c-ts-mode BSD style indentation

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Add else_clause.

2 years agoSupport tree-sitter local parsers
Yuan Fu [Wed, 6 Sep 2023 02:57:34 +0000 (19:57 -0700)]
Support tree-sitter local parsers

* doc/lispref/parsing.texi (Multiple Languages): Update manual.
* lisp/treesit.el (treesit-range-settings): Add LOCAL-P to range
setting.
(treesit-range-rules): Support :local keyword.
(treesit-local-parsers-at)
(treesit-local-parsers-in)
(treesit--update-ranges-local): New functions.
(treesit-update-ranges)
(treesit-font-lock-fontify-region)
(treesit--indent-1): Support local parsers and prioritize it over
global parsers.

2 years agoAllow filter by tag in treesit-parser-list
Yuan Fu [Tue, 5 Sep 2023 06:45:21 +0000 (23:45 -0700)]
Allow filter by tag in treesit-parser-list

* doc/lispref/parsing.texi: Update manual.
* src/treesit.c (Ftreesit_parser_create): Disallow using t for tag.
(Ftreesit_parser_list): Add LANGUAGE and TAG parameter.

2 years agoUse tagged parser in c-ts-mode
Yuan Fu [Tue, 5 Sep 2023 03:05:50 +0000 (20:05 -0700)]
Use tagged parser in c-ts-mode

Now that we have tags for parsers, use that instead of the
load-name-override hack.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--emacs-c-range-query): Change parser to C.
(c-ts-mode--emacs-set-ranges): Use the tagged parser.
(c-ts-mode): Create the tagged parser.

2 years agoAdd tag to tree-sitter parsers
Yuan Fu [Mon, 4 Sep 2023 22:33:19 +0000 (15:33 -0700)]
Add tag to tree-sitter parsers

* doc/lispref/parsing.texi (Using Parser): Update manual.
* lisp/treesit.el (treesit-buffer-root-node)
* src/treesit.c (make_treesit_parser)
* src/treesit.c (Ftreesit_parser_create): Add TAG parameter.
(treesit_resolve_node): Create a parser with nil tag.
* src/treesit.h (Lisp_TS_Parser): Add TAG field.

2 years agoFix libgccjit build on Haiku
Po Lu [Wed, 6 Sep 2023 03:19:32 +0000 (11:19 +0800)]
Fix libgccjit build on Haiku

* configure.ac (LIBGCCJIT_LIBS): Link only with -lgccjit under
Haiku.

2 years agoProperly run emacsclient under Android if DISPLAY is set
Po Lu [Wed, 6 Sep 2023 02:31:26 +0000 (10:31 +0800)]
Properly run emacsclient under Android if DISPLAY is set

* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Make
dimensions final, since they are never changed after the
constructor.

* lib-src/emacsclient.c (decode_options): If --display is not
provided, always set display to `android' even if DISPLAY is
provided.

* lisp/net/browse-url.el (browse-url): Cease setting DISPLAY
under Android.

* src/callproc.c (getenv_internal, make_environment_block):
Don't afford DISPLAY special treatment under Android.

2 years agoCorrectly handle common prefixes in substring completion
Spencer Baugh [Tue, 5 Sep 2023 19:40:06 +0000 (15:40 -0400)]
Correctly handle common prefixes in substring completion

Substring completion would previously not complete the longest common
substring if that substring was a prefix of all the completion
alternatives.  Now it does.  An explanation of this bug

Substring completion is implemented by passing the `prefix' symbol as
part of the pattern passed to completion-pcm--merge-completions.  This
symbol is supposed to cause completion-pcm--merge-completions to
"grow" a completion of a common substring only from the "right" of the
symbol (a common suffix), not from the "left" of the symbol (a common
prefix).  Yes, this is the opposite of what the name `prefix' would
imply.

When processing a symbolic element of the pattern,
completion-pcm--merge-completions first finds the common prefix of all
the completions in that part of the pattern (using try-completion).
Then for `prefix' and other elements which want to complete a common
suffix, the common prefix is removed from each element and then the
common suffix is calculated with completion--common-suffix.

If the common prefix covers the entirety of all the alternatives
(i.e. when "unique" is true in the code), it's also a common suffix.
In that case, the common suffix calculation (if it runs) is basically
a no-op which will produce an empty string, since we removed the
common prefix before running it.

Before this change, `prefix' elements would unconditionally discard
the common prefix, which produced the wrong result in the case that
common prefix == common suffix.  For example:

  (completion-pcm--merge-completions '("ab" "ab") '(prefix "b"))
  -> ("b")

Now we detect this situation and include the common prefix in this
case for `prefix' elements.  Then we get:

  (completion-pcm--merge-completions '("ab" "ab") '(prefix "b"))
  -> ("b" "a")

which is correct.

* lisp/minibuffer.el (completion-pcm--merge-completions): Don't ignore
a common suffix in a `prefix' pattern element when it's also a common
prefix.
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test.

2 years agoMake `dns-mode` fontify quoted values correctly
Stefan Kangas [Tue, 5 Sep 2023 21:06:21 +0000 (23:06 +0200)]
Make `dns-mode` fontify quoted values correctly

* lisp/textmodes/dns-mode.el (dns-mode-syntax-table): Fontify
quoted values correctly.  (Bug#62214)
Suggested by Trent W. Buck <trentbuck@gmail.com>.

2 years agoImprove completion of treesit-check-indent command
Daniel Martín [Mon, 12 Dec 2022 10:33:01 +0000 (11:33 +0100)]
Improve completion of treesit-check-indent command

* lisp/treesit.el (treesit--read-major-mode): Helper function to
provide completion for most major modes.
(treesit-check-indent): Use the new interactive spec and improve the
docstring.  (Bug#60001)

2 years agoFlymake: speed up mode-line display with simple cache
João Távora [Tue, 5 Sep 2023 16:20:25 +0000 (17:20 +0100)]
Flymake: speed up mode-line display with simple cache

When scrolling heavily (perhaps holding down C-n), the function
'flymake-mode-line-counter' showed very prominently in the memory and
CPU profiles.

Using a cache here was trivial, if not particularly pretty.  The
function all but disappears from the profiles afterwards.

* lisp/progmodes/flymake.el (flymake--mode-line-counter-cache):
New variable.
(flymake--publish-diagnostics): Flush cache aggressively.
(flymake-mode-line-error-counter): Adjust.
(flymake--mode-line-counter-1): New helper from earlier
flymake--mode-line-counter.
(flymake--mode-line-counter): Use cache.

2 years ago* lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Mark as obsolete
Stefan Monnier [Tue, 5 Sep 2023 16:56:13 +0000 (12:56 -0400)]
* lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Mark as obsolete

* lisp/emacs-lisp/cl-preloaded.el: Emit a message before enabling
`cl-old-struct-compat-mode`.

See bug#63282.

2 years ago* lisp/emacs-lisp/pp.el (pp-28): Fix typo
Stefan Monnier [Tue, 5 Sep 2023 16:29:44 +0000 (12:29 -0400)]
* lisp/emacs-lisp/pp.el (pp-28): Fix typo

Reported by Mattias Engdegård <mattias.engdegard@gmail.com>.

2 years agoMerge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs
Stefan Monnier [Tue, 5 Sep 2023 15:55:14 +0000 (11:55 -0400)]
Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs

2 years ago* lisp/emacs-lisp/edebug.el (edebug-list-form): Don't gate so eagerly
Stefan Monnier [Tue, 5 Sep 2023 15:54:55 +0000 (11:54 -0400)]
* lisp/emacs-lisp/edebug.el (edebug-list-form): Don't gate so eagerly

The `edebug-gate` is fairly heavy handed, so don't activate it
just because we seem to have found what looks like a valid form.

2 years agoDisplay directory when `dired-omit-mode` is first enabled
Stefan Kangas [Tue, 5 Sep 2023 15:50:27 +0000 (17:50 +0200)]
Display directory when `dired-omit-mode` is first enabled

* lisp/dired-x.el (dired-omit-expunge): Display the directory name
when 'dired-omit-mode' is first enabled.  (Bug#64705)

2 years ago(regexp-tests-backtrack-optimization): Mark it as failing
Stefan Monnier [Tue, 5 Sep 2023 14:54:25 +0000 (10:54 -0400)]
(regexp-tests-backtrack-optimization): Mark it as failing

* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
The fix for bug#65726 broke some of the optimization added for bug#61514.

2 years ago; Add regression test for bug#65726
Mattias Engdegård [Tue, 5 Sep 2023 13:39:29 +0000 (15:39 +0200)]
; Add regression test for bug#65726

* test/src/regex-emacs-tests.el
(regex-tests-mutual-exclusive-inf-rec): New test.

2 years ago* doc/lispref/functions.texi (Advising Named Functions): Clarify " no advice"
Stefan Monnier [Tue, 5 Sep 2023 12:57:27 +0000 (08:57 -0400)]
* doc/lispref/functions.texi (Advising Named Functions): Clarify " no advice"

2 years agoMinor adjustments to Android port stubs
Po Lu [Tue, 5 Sep 2023 06:38:33 +0000 (14:38 +0800)]
Minor adjustments to Android port stubs

* src/androidfns.c (Fx_display_backing_store): Return
`when-mapped' in place of `always', since the former better
reflects Android port behavior.
(syms_of_androidfns) <always>: Delete defsym.
<when-mapped>: New defsym.

* src/term.c (Fsuspend_tty, Fresume_tty): Properly signal errors
on Android rather than quietly disregarding calls.

2 years ago; Delete some commented out code in data.c (Bug#64595)
Stefan Kangas [Tue, 5 Sep 2023 06:10:02 +0000 (08:10 +0200)]
; Delete some commented out code in data.c (Bug#64595)

* src/data.c (set_internal): Delete commented out code.

2 years agoInherit 'sieve-mode' faces from 'font-lock'
Jim Porter [Tue, 5 Sep 2023 04:37:56 +0000 (21:37 -0700)]
Inherit 'sieve-mode' faces from 'font-lock'

These Sieve faces were already a close mapping onto the Font Lock
ones, so this should usually look the same to users with the default
theme.  However, this makes it easier to theme these faces (just
define the usual 'font-lock-*-face' colors you want) and also fixes a
few edge cases (bug#62370).

* lisp/net/sieve-mode.el (sieve-control-commands)
(sieve-action-commands, sieve-test-commands, sieve-tagged-arguments):
Inherit from 'font-lock' faces.

2 years agoAvoid virtual function dispatch overhead
Po Lu [Tue, 5 Sep 2023 02:43:07 +0000 (10:43 +0800)]
Avoid virtual function dispatch overhead

* src/androidvfs.c (android_saf_move_document): Circumvent JNI
dynamic function dispatch on call to final method.

2 years agoMerge remote-tracking branch 'refs/remotes/origin/master'
Stefan Monnier [Mon, 4 Sep 2023 21:14:14 +0000 (17:14 -0400)]
Merge remote-tracking branch 'refs/remotes/origin/master'

2 years ago* lisp/emacs-lisp/cl-macs.el (cl-flet): Remove `&name` for (SYM EXP) case
Stefan Monnier [Mon, 4 Sep 2023 21:13:45 +0000 (17:13 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl-flet): Remove `&name` for (SYM EXP) case

The new/current Edebug spec gives the name `SYM@cl-flet@NN` to the
expression building that function rather than to the body of that
function as would be expected, leading to misleading code coverage.

This basically reverts 999de2a5ea36cc0f546825e0, and 18c85306ac21 :-(

2 years agoAdd 'appt-notification' face (Bug#61661)
Protesilaos Stavrou [Mon, 20 Feb 2023 19:03:08 +0000 (21:03 +0200)]
Add 'appt-notification' face (Bug#61661)

* lisp/calendar/appt.el (appt-notification): Declare the new face.
(appt-check): Implement the new face.
* etc/NEWS: Announce the new face.

2 years agoMerge remote-tracking branch 'refs/remotes/origin/master'
Stefan Monnier [Mon, 4 Sep 2023 20:42:15 +0000 (16:42 -0400)]
Merge remote-tracking branch 'refs/remotes/origin/master'

2 years ago* lisp/tab-bar.el (cl--set-substring): Remove left-over autoload
Stefan Monnier [Mon, 4 Sep 2023 20:41:40 +0000 (16:41 -0400)]
* lisp/tab-bar.el (cl--set-substring): Remove left-over autoload

And remove left-over `require` of `seq` while at it.

2 years agoMove `setf substring` to cl-lib since it relies on it (bug#60102)
Stefan Monnier [Mon, 4 Sep 2023 20:39:55 +0000 (16:39 -0400)]
Move `setf substring` to cl-lib since it relies on it (bug#60102)

* lisp/emacs-lisp/cl-lib.el (substring): Move gv-expander here...
* lisp/emacs-lisp/gv.el (substring): ...from here.

2 years agoEglot: add new chapter about Elisp extensions to Eglot manual
João Távora [Mon, 4 Sep 2023 00:39:05 +0000 (01:39 +0100)]
Eglot: add new chapter about Elisp extensions to Eglot manual

bug#65418

Co-authored-by: Filippo Argiolas <filippo.argiolas@gmail.com>
* doc/misc/eglot.texi (Extending Eglot): New chapter.

2 years agoEglot: reorganize Elisp API section, export new functions
João Távora [Sun, 3 Sep 2023 23:15:55 +0000 (00:15 +0100)]
Eglot: reorganize Elisp API section, export new functions

bug#65418

Co-authored-by: Filippo Argiolas <filippo.argiolas@gmail.com>
* lisp/progmodes/eglot.el (Obsolete aliases): New section, move
all obsolete aliases here.
(eglot-uri-to-path)
(eglot-path-to-uri)
(eglot-range-region)
(eglot-server-capable)
(eglot-server-capable-or-lose): New functions and backward compability
aliases.

2 years agoRevert use of seq-count in shr-count
Stefan Kangas [Mon, 4 Sep 2023 19:28:33 +0000 (21:28 +0200)]
Revert use of seq-count in shr-count

* lisp/net/shr.el (shr-count): Prefer handwritten code to using
'seq-count', as it's more performant.
Problem reported by Mattias Engdegård <mattiase@acm.org>.

2 years ago* src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop (bug#65726)
Stefan Monnier [Mon, 4 Sep 2023 17:11:31 +0000 (13:11 -0400)]
* src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop (bug#65726)

2 years ago; * lisp/net/shr.el (shr-count): Fix typo.
Stefan Kangas [Mon, 4 Sep 2023 16:27:54 +0000 (18:27 +0200)]
; * lisp/net/shr.el (shr-count): Fix typo.

2 years agoUse seq-count in three functions
Stefan Kangas [Mon, 4 Sep 2023 16:24:31 +0000 (18:24 +0200)]
Use seq-count in three functions

* lisp/net/shr.el (shr-count):
* lisp/progmodes/idlwave.el (idlwave-count-memq): Use seq-count.
(idlwave-count-eq): Use seq-count.  Make obsolete, as it is unused.

2 years agoUse new ERT `skip-when` macro in tests
Stefan Kangas [Sun, 3 Sep 2023 19:04:02 +0000 (21:04 +0200)]
Use new ERT `skip-when` macro in tests

* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file):
* test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests):
* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--library-completion):
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-pipeline):
* test/lisp/filenotify-tests.el (file-notify-test11-symlinks):
* test/lisp/ibuffer-tests.el (ibuffer-0autoload):
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-part1):
* test/lisp/net/network-stream-tests.el (echo-server-nowait)
(connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait)
(open-network-stream-tls-wait, open-network-stream-tls-nowait)
(open-network-stream-tls, open-network-stream-tls-nocert)
(open-gnutls-stream-new-api-nowait)
(open-gnutls-stream-old-api-nowait):
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-10483)
(cperl-test-hyperactive-electric-else):
* test/lisp/progmodes/elisp-mode-tests.el
(eval-last-sexp-print-format-sym-echo)
(eval-last-sexp-print-format-small-int-echo)
(eval-last-sexp-print-format-large-int-echo)
(eval-defun-prints-edebug-when-instrumented):
* test/lisp/progmodes/python-tests.el (python-ffap-module-path-1):
* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
(shadow-test01-sites, shadow-test02-files)
(shadow-test03-expand-cluster-in-file-name)
(shadow-test04-contract-file-name, shadow-test05-file-match)
(shadow-test06-literal-groups, shadow-test07-regexp-groups)
(shadow-test08-shadow-todo, shadow-test09-shadow-copy-files):
* test/lisp/simple-tests.el
(eval-expression-print-format-sym-echo)
(eval-expression-print-format-small-int-echo)
(eval-expression-print-format-large-int-echo):
* test/lisp/term-tests.el (term-simple-lines)
(term-carriage-return, term-line-wrap, term-colors)
(term-colors-bold-is-bright, term-cursor-movement)
(term-scrolling-region, term-set-directory)
(term-line-wrapping-then-motion, term-to-margin):
* test/lisp/thread-tests.el
(thread-tests-list-threads-error-when-not-configured):
* test/lisp/vc/vc-tests.el (backend):
* test/manual/scroll-tests.el (scroll-tests-scroll-margin-0)
(scroll-tests-scroll-margin-negative)
(scroll-tests-scroll-margin-max)
(scroll-tests-scroll-margin-over-max)
(scroll-tests-scroll-margin-whole-window):
* test/misc/test-custom-libs.el (test-custom-libs):
* test/src/emacs-module-tests.el (module/async-pipe):
* test/src/fileio-tests.el (fileio-tests--odd-symlink-chars):
* test/src/filelock-tests.el (filelock-tests-lock-spoiled)
(filelock-tests-file-locked-p-spoiled)
(filelock-tests-unlock-spoiled)
(filelock-tests-kill-buffer-spoiled)
(filelock-tests-detect-external-change):
* test/src/image-tests.el
(image-tests-image-size/error-on-nongraphical-display)
(image-tests-image-mask-p/error-on-nongraphical-display)
(image-tests-image-metadata/error-on-nongraphical-display):
* test/src/process-tests.el (make-process/mix-stderr)
(process-tests/fd-setsize-no-crash/make-network-process)
(process-tests/fd-setsize-no-crash/make-serial-process):
Use ERT `skip-when` macro in tests.

2 years agoAdd `skip-when` macro to `ert-deftest`
Stefan Kangas [Sun, 3 Sep 2023 16:45:16 +0000 (18:45 +0200)]
Add `skip-when` macro to `ert-deftest`

This can help avoid some awkward test skip conditions.

For example, this triple negation:
    (skip-unless (not noninteractive))

Can be written as the simpler:
    (skip-when noninteractive)

* lisp/emacs-lisp/ert.el (ert-deftest): Add new 'skip-when' macro.
(ert--skip-when): New internal function.
* doc/misc/ert.texi (Tests and Their Environment): Document above
new macro.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-skip-when): New test.

2 years ago; * lisp/files.el (save-some-buffers-functions): Doc fix (bug#65414).
Eli Zaretskii [Mon, 4 Sep 2023 16:06:19 +0000 (19:06 +0300)]
; * lisp/files.el (save-some-buffers-functions): Doc fix (bug#65414).